import request from "@/utils/request";

// 查询受控端服务列表
export function severMangeList(query) {
  return request({
    url: "/sources/skSystem/page",
    method: "get",
    params: query,
  });
}

//懒加载软件历史版本
export function lazyLoadHistoryChildren(softwareId) {
  return request({
    url: "/sources/software/history/all/" + softwareId,
    method: "get",
  });
}

//资源状态详情
export function getSourceStatus(query) {
  return request({
    url: "/sources/resourceMonitor/detail",
    method: "get",
    params: query,
  });
}
// 资源网卡信息
export function selectNetChartList(query) {
  return request({
    url: "/sources/resourceMonitor/selectNetChartList",
    method: "get",
    params: query,
  });
}

//手动连接
export function handConnect(query) {
  return request({
    url: "/sources/skSystem/connect",
    method: "get",
    params: query,
    timeout: 100000,
  });
}

// 校验目标文件夹是否上传过
export function validUpload(query) {
  return request({
    url: "/sources/skSystemProcess/uploadPath",
    method: "get",
    params: query,
  });
}
// 校验受控服务器是否在线
export function skIsOnline(query) {
  return request({
    url: "/sources/skSystem",
    method: "get",
    params: query,
  });
}

// 执行停止脚本
export function executeStopBat(id, query) {
  return request({
    url: "/sources/skSystemProcess/" + id + "/stopShell",
    method: "get",
    params: query,
  });
}
// 执行卸载脚本
export function executeUninsBat(id, query) {
  return request({
    url: "/sources/skSystemProcess/" + id + "/unloadShell",
    method: "get",
    params: query,
  });
}

// 执行启动脚本
export function executeStartBat(id, query) {
  return request({
    url: "/sources/skSystemProcess/" + id + "/startShell",
    method: "get",
    params: query,
  });
}

// 查询软件列表
export function getSoftwareDescList(query) {
  return request({
    url: "/sources/skSystem/pageSoftware",
    method: "get",
    params: query,
  });
}

// 查重软件列表名称
export function getDistinctName(query) {
  return request({
    url: "/sources/skSystem/distinctName",
    method: "get",
    params: query,
  });
}


// 新增手动部署软件
export function addHandleSoftware(data) {
  return request({
    url: "/sources/skSystem/addHandleSoftware",
    method: "post",
    data: data,
  });
}

// 修改手动部署软件
export function updateHandleSoftware(data) {
  return request({
    url: "/sources/skSystem/updateHandleSoftware",
    method: "put",
    data: data,
  });
}

// 修改手动部署软件
export function deleHandleSoftware(data) {
  return request({
    url: "/sources/skSystem/delHandleSoftware",
    method: "delete",
    data: data,
  });
}
